package com.shitou.util;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import com.shitou.pojo.Report;

public class ReportTag extends SimpleTagSupport{

	private Report report;

	@Override
	public void doTag() throws JspException, IOException {
		JspWriter out = getJspContext().getOut();
		out.println("<table style=\"display: none;\" id=\"project"+report.getId()+"\" border=\"1\" align=\"center\">");
		out.println("<tr> <th>&nbsp;</th> <th>任务</th> <th>错误</th> <th>想法</th> </tr>");
		out.println("<tr> <td>未完成</td> <td>"+report.getMap().get("任务").getUndone()+"</td> <td>"+report.getMap().get("错误").getUndone()+"</td> <td>"+report.getMap().get("想法").getUndone()+"</td> </tr>");
		out.println("<tr> <td>未完成</td> <td>"+report.getMap().get("任务").getDone()+"</td> <td>"+report.getMap().get("错误").getDone()+"</td> <td>"+report.getMap().get("想法").getDone()+"</td> </tr>");
		out.println("</table>");
	}
	
	public Report getReport() {
		return report;
	}

	public void setReport(Report report) {
		this.report = report;
	}
}
